package com.xiang.sql.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.xiang.api.common.ListStringHandler;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 奖品链接 数据实体
 * 
 * @author mac-xiang
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "`prize_group`", autoResultMap = true)
@ApiModel(value = "奖品链接 对象", description = "奖品链接")
public class PrizeGroup implements Serializable {

  private static final long serialVersionUID = 1L;
  /** 主键ID */
  @TableId(value = "id", type = IdType.ASSIGN_ID)
  public String id;

  /** 创建人id */
  @TableField(value = "`create`", fill = FieldFill.INSERT)
  public String create;

  /** 扫码人id */
  @TableField(value = "`user`", fill = FieldFill.INSERT)
  public String user;

  /** 核销商户id */
  @TableField(value = "`group`", fill = FieldFill.INSERT)
  public String group;

  /** 兑奖时间 */
  @TableField(value = "`cash_time`", fill = FieldFill.INSERT)
  public Long cashTime;

  /** 创建时间 */
  @TableField(value = "`create_time`", fill = FieldFill.INSERT)
  public Long createTime;

  /** 首次扫码时间 */
  @TableField(value = "`use_time`")
  public Long useTime;

  /** 名称 */
  @TableField(value = "`name`", fill = FieldFill.INSERT)
  public String name;

  /** 奖品id */
  @TableField(value = "`prize`", fill = FieldFill.INSERT)
  public String prize;

  /** 奖池内容 */
  @TableField(value = "`content`", fill = FieldFill.INSERT, typeHandler = ListStringHandler.class)
  public List<String> content;

  public PrizeGroup() {
  }

  public PrizeGroup clone(String id) {
    PrizeGroup ret = new PrizeGroup();
    ret.id = id;
    ret.create = create;
    ret.createTime = createTime;
    ret.useTime = useTime;
    ret.name = name;
    ret.prize = prize;
    ret.content = new ArrayList<>();
    ret.content.addAll(content);
    return ret;
  }
}